package com.wuyixu.service.impl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wuyixu.dao.SpuMapper;
import com.wuyixu.domain.Spu;
import com.wuyixu.domain.SpuVo;

import com.wuyixu.service.SpuService;
@Service(interfaceClass = SpuService.class)
public class SpuServiceImpl implements SpuService{
	@Autowired
	private SpuMapper spuMapper;
	@Override
	public int add(Spu spu) {
		// TODO Auto-generated method stub
		return spuMapper.add(spu);
	}

	@Override
	public int update(Spu spu) {
		// TODO Auto-generated method stub
		return spuMapper.update(spu);
	}

	@Override
	public int delete(int[] ids) {
		// TODO Auto-generated method stub
		return spuMapper.del(ids);
	}

	@Override
	public PageInfo<Spu> list(SpuVo spuVo) {
		// TODO Auto-generated method stub
		PageHelper.startPage(spuVo.getPageNum(), spuVo.getPageSize());
		return new PageInfo<Spu>(spuMapper.list(spuVo));
	}

	@Override
	public Spu getById(int id) {
		// TODO Auto-generated method stub
		return spuMapper.getById(id);
	}

}
